package pearson.automation.forms.courseDetails;

import framework.elements.Button;

import org.openqa.selenium.By;

import framework.BaseForm;

/**
 * Form for popup message with new course's template selection 
 *
 */
public class CourseTemplates extends BaseForm {

    private static Button blankTemplate = new Button(By.xpath("//ul[@class='template-list']//a[contains(.,'Blank template')]"), "Blank template");
    private static Button eightWeekDevRy = new Button(By.xpath("//ul[@class='template-list']//a[contains(.,'8 Week DeVry Course')]"), "8 Week DeVry Course");

    public enum COURSE_TEMPLATES {
    BLANK, DEVRY
    };

    public CourseTemplates() {
    super(blankTemplate.getLocator(), "Course templates");
    }

    public void selectTemplate(COURSE_TEMPLATES template) {
    switch (template) {
    case BLANK:
        blankTemplate.clickAndWait();
        break;
    case DEVRY:
        eightWeekDevRy.clickAndWait();
        break;
    }
    }
}
